package com.dyw.crashcatch;

import android.content.Context;

import java.io.File;

public class NativeCrash {

    static {
        System.loadLibrary("nativecrashcatch");
    }

    public static void init(Context context) {
        Context applicationContext = context.getApplicationContext();
        File file = new File(applicationContext.getCacheDir(), "native_crash");
        if (!file.exists()) {
            file.mkdirs();
        }
        initNativeCrash(file.getAbsolutePath());
    }

    static native void initNativeCrash(String path);

    public static native void triggerNativeCrash();
}
